const mongoose = require('mongoose')
// 创建管理员列表结合的约束对象
const adminSchema = mongoose.Schema({
    adminName: {
        type: String,
        unique: true,//是否唯一
        required: true//是否为必填项
    },
    password: {   //密码的意思
        type: String,
        required: true
    },
    regTime: {  //注册时间
        type: String,
        required: true
    },
    loginTime: {
        type: String,
        required: true,
        default: "----"//默认值,值可以随意用任何符号代替
    },
    status: {
        type: Number,
        require: true,
        default: 0
    }
});


//根据这个 adminSchema的约束对象,去创建某个集合
const adminModel = mongoose.model("adminList", adminSchema);

module.exports = adminModel;